function [act logact] = gaussRobustUncertainty(mu, covar, Y, C)


[N D] = size(Y);
inv_covar = inv(covar);

centered_Y = Y - repmat(mu, N, 1);
exp_dist2 = sum(centered_Y*inv_covar.*centered_Y, 2);

logact = - D*log(2*pi) - logdet_chol(covar) - exp_dist2;
logact = logact - reshape(C, D*D, N)'*inv_covar(:);
logact = logact*0.5;

act = exp(logact);
